Skip to content

CERT 8687 Realistic example #167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: cli-beta
Choose a base branch
from
Open

Conversation

nivcertora
Copy link
Contributor

https://certora.atlassian.net/browse/CERT-8687

Note We need to adjust the example as the invariant is currently violated in both semantic versions.
@nd-certora let me know how to fix it.

@yoav-el-certora yoav-el-certora requested a review from johspaeth May 19, 2025 13:19
Copy link
Contributor

@johspaeth johspaeth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example is way better now and easier to me. Looks good to me.

Is this subsuming #166 or do we take both examples?

## Key Points

- **Old semantics**: Using `requireInvariant` in non-boundary contexts (e.g., hooks, summaries) could lead to false verification results. The invariant might be incorrectly considered satisfied inline, missing real violations.
- **New semantics**: `requireInvariant` is enforced only at valid rule boundaries (e.g., after function calls, subcalls, or havocs if `strong`). This ensures that violations are properly detected.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nd-certora I'd like to double check what happens in the case of a strong invariant that is havoced, do you have a good example here? I attempted to create one for testing but wasn't yet succeeding. Do you have an idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants